package com.wwt.springboot_vue.service;



import com.wwt.springboot_vue.bean.Notice;
import com.wwt.springboot_vue.mapper.NoticeMapper;
import org.apache.ibatis.jdbc.Null;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    public  int save(Notice notice){
        if (notice.getNotice_id() == null){  // notice没有id， 则表示是新增
          return   noticeMapper.insert(notice);
        }else { //否则为更新
             return  noticeMapper.update(notice);
        }

    }


}
